<div>
    <h2>Hello, <?php echo $_SESSION['uname'] ?>. These are your files in the cloud!</h2>

    
    <?php
        $res = mysql_query("SELECT * FROM `repo` WHERE `user_id` = ". $_SESSION['uid']);
        while($row = mysql_fetch_row($res)) {
            $fname = $row[3];
            $name = substr($fname, strrpos($fname, '/'));
            $rev = $row[2];
            $path = "downloader.php?fname=$fname&name=$name&rev=$rev";
    ?>
        <a class="file" href="<?php echo $path ?>"><?php echo $row[3] ?></a>
    <?php } ?>
    

    <a href="index.php?logout=1" class="logout">logout</a>
</div>